import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import layout from '../layout/index.vue'
import Layouts from '../components/test/layout.vue'
import Qrcodejs from '../components/test/qrcodejs2.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/all',
    name: 'AllTestPage',
    component: ()=>import(/* webpackChunkName: "AllTestPage" */ '@views/allTestPage.vue'),
    children: [
      
    ]
  },
  {
    path: '/easyTable',
    name: 'EasyTable',
    component: ()=>import(/* webpackChunkName: "AllTestPage" */ '@views/easyTable/index.vue'),
    children: [
      
    ]
  },
  {
    path: '/umyTable',
    name: 'UmyTable',
    component: ()=>import(/* webpackChunkName: "AllTestPage" */ '@views/umyTable/index.vue'),
    children: [
      
    ]
  },
  {
    path: '/first-form',
    name: 'FirstForm',
    component: ()=>import(/* webpackChunkName: "AllTestPage" */ '@components/public-form/firstForm.vue')
  },
  {
    path: '/public',
    component: layout,
    redirect: '/public/yd',
    children: [
      {
        path: 'yd',
        name: 'YdComponents',
        component: ()=>import(/* webpackChunkName: "AllTestPage" */ '@views/ydComponents/index.vue')
      }
    ]
  },
  {
    path: '/report',
    name: 'MyBlank',
    component: ()=>import(/* webpackChunkName: "AllTestPage" */ '@views/blank.vue'),
    children: [
      {
        path: 'SalesFirstConsultationReport',
        name: 'SalesFirstConsultationReport',
        component: ()=>import(/* webpackChunkName: "AllTestPage" */ '@views/report/1.vue')
      }
    ]
  },
  {
    path: '/tables',
    name: 'tables',
    component: ()=>import(/* webpackChunkName: "AllTestPage" */ '@/components/HelloWorld.vue')
  },
  
  {
    path: '/ceshi',
    name: 'ceshi',
    component: layout,
    children: [
      {
        path: 'ceshi-router',//使用的时候 他就是相对路由 xxx.com/#/ceshi/ceshi-router 出现的位置是layout中的router-view中
        name: 'TestRouter',
        component: ()=>import(/* webpackChunkName: "AllTestPage" */ '../views/testRouter/index.vue'),
        meta: {
          keepAlive: true
        }
      },{
        path: 'qrcodejs',//使用的时候 他就是相对路由 xxx.com/#/ceshi/ceshi-router 出现的位置是layout中的router-view中
        name: 'Qrcodejs',
        component: Qrcodejs,
        meta: {
          keepAlive: true
        }
      },
      {
        path: '/ceshi-router',//使用的时候 他就是绝对路由 xxx.com/#/ceshi-router  出现的位置是layout中的router-view中（虽然直接访问这个path但是页面层级确实layout中的）
        name: 'ceshiRouter',
        component: ()=>import(/* webpackChunkName: "AllTestPage" */ '../views/testRouter/index.vue'),
        meta: {
          keepAlive: true
        }
      },
      {
        path: 'inputs',//使用的时候 他就是绝对路由 xxx.com/#/ceshi-router  出现的位置是layout中的router-view中（虽然直接访问这个path但是页面层级确实layout中的）
        name: 'inputs',
        component: ()=>import(/* webpackChunkName: "inputs" */ '../views/inputs/index.vue'),
        meta: {
          keepAlive: true
        }
      },    
      {
        path: 'layout',//使用的时候 他就是绝对路由 xxx.com/#/ceshi-router  出现的位置是layout中的router-view中（虽然直接访问这个path但是页面层级确实layout中的）
        name: 'layout',
        component: Layouts,
        meta: {
          keepAlive: true
        }
      }
    ]
  },
  {
    path: '/ceshi-router2',//使用的时候 他就是相对路由 xxx.com/#/ceshi-router2  出现的位置是app.vue中的router-view中不会出现layout的层级和页面内容
    component: ()=>import(/* webpackChunkName: "AllTestPage" */ '../views/testRouter/index.vue'),
    meta: {
      keepAlive: true
    }
  },
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ '../views/About.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
